/*
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
#define  num 15
long long min1=0,max1=0;
long long temp,n;
int ti;
int primes[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};

void calc(int ss[],int begin,double use,long long before){
	int te=0;
	temp=before*primes[begin];
	if(temp>n)
		return;
	else if(use)
	if(begin==num-1){
		
		temp=1;
		for(int i=1;i<=ss[begin];i++){
			temp=before*pow(primes[begin],i);
			if(temp<=n){
				ti=use*i;
				if(ti>max1){
					max1=ti;min1=temp;
				}
			}else
				return;
		}
	}else{
		for(int i=begin;i<num;i++){
			for(int k=1;k<=ss[i];k++)
				calc(ss,i+1,use*k,before*pow(primes[i],k));

		}
	}

}
int main(){
	long long  n;

	int ss[num];
	cin>>n;
	for(int i=0;i<num;i++){
		int tmp=primes[i],te=0;
		while(tmp<n){
			te++;
			tmp*=primes[i];
		}
		ss[i]=te;
	}

	for(int i=0;i<num;i++)
		cout<<ss[i]<<",";
	calc(ss,0,1,1);

	cout<<min1<<endl;
	cout<<endl;

	system("pause");
	return 0;
}
*/